Added more self checks on existing files/directories