Bugfix

Fixes a couple of bugs that were causing HEAD not to function and adds some tests.
Add a comment here to remind the reader of what the "load" action is and why this stuff should happen then.