Fix while loop, close #134