Fixes for issue #295