core: Fix wrong exception raised.
tests: Cram test new output.
Fix whitespace errors.