The fix is the change in the MAXPATHLEN check, but have also migrated this to Common::String to make the fix easier. Thanks to klusark for pointing out this problem.