Changed the way sub-commands are handled.