Added explicit cast to suppress warnings (behavior is correct)