Fix performance issue with the shadow.