2.4 maintenance

Miscellaneous patches for 2.4 maintenance. This is a follow-up of pull request #515