Fix most of the deprecated function warnings (OSX 10.10.1)