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

Fix minor issues + Add tests