Fix a rather annoying bug