Fixed a possible assertion error.