Fixed typo in while not empty loop.