* Check hooks after expected errors, not just when there are none
Some unit tests had intentional errors, and code to verify that the
appropriate hooks were called, but we never checked.
* Update unit tests to match hooks, now that we are checking
* Fix bug revealed by checking the hooks
Or in other words, bug #161 (thanks abakhirkin for the fix)
* Fix link in documentation