Fix #574 - infinite loop, sorry everyone