Added test for exceptions on bad codes