Fixing missing test cases, moved the firing of the exception