Bugfixes. Works from the command-line now.