Small fixes to conform to updated yamsql format
Also contains a small fix for Postgres v9.4