Correct bad type for substr