use for instead of while in ForIterator
new function to shorten null/undefined vals for #322