fixed some _r renaming issues