Added support to specifying basepath: when generating RIMs.