Partially fixed the std::bad_cast and display issues on Mac OS X (I suspect an incompatibility between 32-bit and 64-bit low-level functions)
Added missing files in demo1