fix for a crash in find_optimal_blockcount()