Fixed Index bug in arrayToString