Fixed compile errors under llvm-gcc-4.2 (OSX 10.8).

Duplicate of #1159