Improved duration and depth computation, issue #11