Removes some references that are not used