Reverted b7c15ba185b42613b82f3fdc1bd5074a19d07573 and moved it to the develop branch (see #5174)