Fix for the setAnchorId bug