Add unit tests

Add unit tests for issues #60 and #61