Fixed crash bug and removed Xcode 5 warnings.