Fix array sizes and array accesses