protect check_fn in normalizeTrialVariables