Fixed for loop test being occasionally omitted
fixed modulebuilder to not build index into itself