Pulled the last few commits into the main project so I could run it through the tests and fixed a number of bugs.