Fixed some issues with the tests

Some of the tests were (and still are failing), so I went through and fixed some of them. As a sidenote, I suspect that several of tests that are testing out.py are failing because out is still writing to the standard sys.stdout, while the unit tests are using a dummy sys.stdout, but it never gets sent to the 'out' module. Could someone confirm this please? Thanks.