Better pinning test, and checking installed packages as well