Fixed a few bugs, connect to test postgres server.