Refining fix for #1197