Fixed compile errors and warnings related to Optional on Xcode 6.1