Catch more type of errors in tests
Small fix