Made a small change in _findD. Now everything seems to work.