Bug fix so that the program doesn't hang on completion. This closes #28.