Refactor check package updates

One bug fix and minor refactors.