Template and view fixes: round 2

**Resolves #403 and #435**

See #450 for the original PR.

---

- [x] Fix magic forms that got broken by this pull request

---

*Warning: contains schema changes*