Fix error messages and rendering in AssignmentsController.

Closes #576.