Fix while loop syntax