Static analysis bug

When i is 3 commands item [4] is checked while commands only contains 4
items.