Fixes for threshold testing