Added test + fixed a bug in Rm