Clang compilation fixes

These fixes are necessary to allow Cortex to be compiled on OS X Mavericks, where Clang is now the default compiler. I've built this branch successfully both on my earlier OS X 10.7 setup, and on Linux with GCC 4.1.2 - all seems to be OK on all platforms.