Compile fixes and polishing for clang.
Merge pull request #242 from gorthauer/master

Compile fixes and polishing for clang.