Changes to allow compilation with OS X Mavericks and clang