[1.5] Applying old patch from r1642, with further modification from winfried. Also...