fixed typo and NULL to nullptr