Fix issue 240

Use devise to format error messages which weren't being passed through correctly and thus caused the page to break when there were errors.