Using new assertFails method wherever possible to simplify tests.