BUG: When removing directory, use lstat instead of stat to make sure that symlinks are treated as files and not as directories