unmerged changes from 2.4 branch

This changes weren't merged from 2.4 branch into master.