Boolean values for wasUpperLimitHit were reversed.