validate_fn decorator, function annotations, fixes