ORM side fixes.
Merge pull request #752 from doctrine/PgSqlSchemaFix

ORM side fixes.