Latest commit does not fix the issue properly

The latest commit 9695af3337f79bcdad1d6dc78790aed5744a9985 fixes the case when there is already a directory named "tags". It works for cases when the file was not present and when there was a directory, but it does not work for cases when file is present.