Updated tests to check for corresponding exception types