Fixed a bug with a never ending loop. Ägd.