Fixed some problem with the API that prevented making a usable DLL on Windows.