Parse Fix

Fixed an obscure CLI argument parsing bug, and made some tests to prevent regression. This is ready to merge, but feel free to give it a double-check.
yeah this is the kind of subtle bug that i was worried about