Made test suite more thorough, fixed typos and bugs