Adding nose tests, and changes required to make them pass