Fixes to close issue #161