Correct deref() leafref handling