Possibly fixes #384

@madmaxoft, is this the right syntax for lua for loops?