Fix a bug with a crash.