Fix issues with storing of pg results.