Actually got the tests running and working this time; fixed a bug