Rewritten EntityID code, fixed cursor bugs