5.1: Fixed a problem with errors in loops.