x86_64 patch from Bernd