Removing ghost references