Fixes for issue #6