Fixes for issue #48