Fixes for #61
Clean up
Unit test for #61