Fixed a possible crash condition.