Revert, because I branched on from the wrong branch.

Fix optical bug intruduced in #1291 (reverted from commit 7b9a60ffc5e14b73ef365ba509435ae6e7cbfda3)