Added unittests and fixed a few grammar errors.