Fixing a problem in the mock where failed expectations did not throw.
Refactor: Fixing some code issues found by IntelliJ