Added expect_exception and tests