Fixed plenty of warnings and errors that clang throws under Mac 10.9.