More unit testing
Fixed a bug; more unit testing