Fix most of nsd problems