Added basic unit test and fixed a bug.