Fixed an issue where STAT would be called on an empty path