Fix bug regarding to wrong filename length count