Fix a minor issue with getVisibleRange() reporting NaN values, and fix for broken for loop break (minor optimization).