Fixed two array-index bugs.
Partly fixed...