Add tests

Fixed #1