Fixed nested loop test