Further improvement of endInner.