added Postgres, fixed a few bugs