Fix rm function