fix rinit bugs.