replace check_positive and check_finite with check_positive_finite