Added tests, fixed typos