Bug fixes in NaD code.