A similar tool in Rust - [dust](https://github.com/bootandy/dust) - handles junctions correctly. Might be worth a look.