fix several problems with dll