Fixed errors and warnings in Xcode