Fixed up and compiles on XCode 4