rmdir & bug fix in direct patch