rhs_functions fix