fix for issue # 158 (merge from master)