Fix ndll/static logic