Unit tests added. Fixes #17.