Remove 'Use of uninitialized value in substr' warning