Fix install-time dependent adding; add tests