404 controller tests 2

A bunch of controller tests and some other small fixes.