Unit tests

unit tests for issue #169