Fix invalid block generation