Add tests. Relates to #1