Get rid of ICB_MSGSIZE+1, fix various off-by-ones and do some truncation
where necessary.