Fixes for issue #51