Fixed some issues with PG