Change gridStartIterate interface to safely allow recursive calls.

Probably fixes ticket:3894.
qtscript: Fix a typo in structure health calculation. Fixes ticket:3930.
Merge branch 'bugfixes' into 3.1