Fixes #6: add tests