Removed unused exceptions.
Tidy-up key tests.