Patch from jdavisp3 to further improve region gain line behaviour, as discussed in...