Fixed performance issue related to Entity.setOptions.