rename works for files
Fixed compilation errors in rename()