Fixes to get it running for me on Mac OSX (10.6 Snow Leopard)
OK, i posted this with the github's in-browser editor but it seems to have screwed up a bunch of the control characters. The only actual changes to use are near the top for those two things there.
Run on Mac OSX
Fixed with bd2aabd