Fixed #5677 (Fix overzealous substr() warning)