Fixing argument parser bug and adding unittests to catch any future regressions.

Signed-off-by: Rob Dobson <rob.dobson@citrix.com>