Remove trailing slash on pkgdb objects both in the logic and the tests