Fixed issue in getting new primaryKey when inserting in PostgreSQL
Minor adjustments to fix