Fixing averaging of ranks for panels