Tweaks to make it work with Postgres and on a box with a non-1000 user.