ackport fixes from 2?5 to 2.4