Tests for exception handling