Fix minor issues + Add tests
Merge pull request #9 from widop/f-refactor

Fix minor issues + Add tests