Unit tests added. Fixes #17.
Merge conflicts