Remove some Xcode warnings and optimization