Bug fix in NightTools