merge and rename AResource to ARootResource. Other fixes