Removing references to a variable that doesn't exist