Fix autoderef ice

Related to #5062, but doesn't fix that one.