Fix for previous commit: constraints; off by one error in arrays