Patch from Egmont Koblinger to implement two extended variants of