Added tests and some small typo fix