Common: Bug fixes to subcommand stuff

Various fixes to get the subcommand stuff working
Common: Fixed argAsInt to handle negative numbers