Fixed misc semantic errors that Xcode 4 brought to light.