FIX: Fixed PGSQL incompatabilities