Fixed decoding in the case of fragmented delimiters #3306

 - also improved tests