Fixed bugs for array declare with error index.