Fix a bug which caused failure when using r as the second CLI argument