Add length check and use PathLowercase instead of UpperCase. #26