Add some unit tests for #77. Resolves #77