Merge earlier improvements into postgresMigrate branch