Fix underflow in RIO and clean some null derefs in RBin