Reorganize argumen parsing.

It seems better but still doesn't seem to be working right...