Fixed wrong handling of dlerror()