Added parameter type validation to record_variables