improvements to check_thresholds, msg_thresholds and exposed and minor tweak to check_threshold return