Fixes broken recognition of where path ends and filename begins.