more fixes for r command