Release 0.3.1

Point release for a bunch of serious bug fixes.