applied patch from Marcus Doemling- fix for variable blocksize depending