Fixes some issues with PostgreSQL on couples of queries
Merge pull request #113 from xillibit/patch-8

Fixes some issues with PostgreSQL on couples of queries