Better argument parsing, fixes #9