fix array list key sort error bug and some crash bugs