Fix bugs in handling of unusual for statements.