Some changes to make it compile on Mac with clang

It still doesn't link though..