Solving 2 bugs in clean_process and read_write_process