Improved viewer code that handles command modifiers.