Fix bug #604 xcode crash