This reverts commit 08b3ccc01a. It was found that this fix inadvertently re-introduces #1523
08b3ccc01a