Corrected command line flag checks.

I fixed what I think are bugs in the command line option code. Pretty simple updates. Feel free to pull them in if they are correct. 

This is my first ever github pull request, so please let me know if I've done anything incorrectly.