fixes to pgdb