Fixed while loop.