Corrected an infinite loop.