Fixed bug in assertRaises (unexpected exceptions not handled correctly