Fixed: tests and enhanced test cover
Merge pull request #219 from toin0u/master

Fixed test, cover more tests and small refactoring