fix issue #161.
Merge pull request #169 from isaacdontjelindell/pg-issue-161

Fix issue #161