3.10.40 merge fixes