Fix cast crash.