Fix #308 - fs.rename does not work on directories