Added 16 unit tests.
Unit tests, minor bug fix.