Use assert_that() instead of stopifnot() for input validity checks.