Some fixes

One big and one small fix for the postgres module