fix indexing issue: do not increment i twice per loop
add range check to make sure, index does not get out of stack
Merge branch 'indexing'

Conflicts:
	scale-z-stack.bsh