Fixes from bkw_. Formatting in app_db.c and handle start right in cdr_pgsql.c