Fix ambiguous cast error on iOS builds