Fixed crash reported by crittercism.