Fix check for installed packages which always errors when upgrade is not required