Applied Tom's v3 patch