Bug fixes

Much superior command-line version of the program.