Included patch from Klaus Kämpf, as used in OBS