[gear] fix bug with return_type and self_test