Fix bug spotted by @ingorichter in #4662 (seems worth having this working
from the get-go)