Fixed array traversal and save error