Precache element type to avoid usort bug