Better 3.1.1 compatibility
merge bug26067 into default