Fixes and tests for #97