Fix a crash on mode parsing