Add tests; Fixes #4