Fixed printing daemon implementation and return codes
Added port selection and application name to postgres driver