Added unit tests (fix #2)