Alot of backports from 3.15 to fixup errors