Fixes for compilation with MSVC

I fixed some Visual Studio compilation problems (if mingw is not a practical option).
There were some DLL keyword placement issues.

I just thought you might want to pull it.