Change parser to more accurately determine command

Author tag for huimin and justin