Replace InternalError with AssertionError