make sure array indexes are >= 0, closes #57