Static analysis bug

When i is 3 commands item [4] is checked while commands only contains 4
items.
Merge pull request #201 from JeroenSack/master

Static analysis bug