fix bug in TWN chainsize calculation