Changed NULL checks to nullptr checks