Fixes bug described by @kalectro