Fix trailing buffer hack.