Fixed bugs in rem and remdup