Properly handle form errors

Fixes #61