Updated some unit tests

To do:
General code cleanup
More unit tests
Merge remote-tracking branch 'github/master'