Fix tags getting cleaned with old files. Fix handling of file permissions. Fixes #12