Fix bug in exceptions test
Remove contract programming in favor of "scope exit"