Bugfix on DLL code