Fixed compiler errors in the test suite

Bring catch into scope and annotate the exception handler with a type.