Fixes for #41

Fixes for issue #41