Merge 2.4 into master

Original pull requests:

* #2742 from StevenPuttemans:feature_3176
* #2768 from SpecLad:useless-loop