Fix assertion error