Check if rval function arguments are valid + unit test