Minor fixes to make the new postgres backend work.