arg parsing issues.

Similar to https://github.com/pebble/lightblue-0.4/commit/a101c13126c242c5597919470c158845fc4208a2