Fix infinite lookup loop.