Minor fixes to postgres