Improved dependency detection.