Improved enable_typechecking in unit test.