fixes for PG