fix array index ranges in state logging