Would have liked to rework this whole area, but it's kind of tricky, so better to first fix that bug!