Bugfix on mode parsing