Ran nosetests and fixed some failed tests.