fix array related compare functions