Fix wrong any_instance detection with runtime information