Added unit tests.
Merge branch 'dev'