Add test coverage and fix minor bugs
Merge pull request #15 from meducation/fix_bugs

Add test coverage and fix minor bugs