Fixes for issue #7