Tweaks and adjustments for tests.
Added unit tests and fixed test case function names.