Fixed mac compatibility with old mods; fixed a few things up for clang