Fixed some bugs in dicom_mod and added the rm_rep_folders script