Fix more indexing bugs. I think that mixing 0-based and 1-based indexing in code is a bad things. I think code should always use 0-based (if that is what is native for the language), and only convert to/from 1-based ASAP when reading from user input, or just at output when giving information back to the user.