Fixed zero-indexed arrays

Given it some fairly brief testing and it seems to work fine.