Improved handling of modes and modifiers