MKdirs, clean and bug fixing