Lots of bug fixes, also switched to PostgreSQL