Fixed errors and leaks from Xcode 5.1