Fix the algorithm for device trust level