Add tests; Quickcheck ftw; Fix #9