Fixes for pull req. #263 as suggested