Fix while loop

Merged Alex Iribarren requested to merge fix into master

Merge request reports