MCP: turn while loop into for loop to prevent infinite looping.

A nice feature during development :)