Fixed some bugs.
Started work on nose tests for cli.