Fixed code to compile under clang on Mac (hopefully Linux too).

See title. Can someone please try compiling these changes under Linux and Windows please? :)