Fix ldep implementation