Fixed warnings and got it working on MacOS X (Yosemite)