Changed nullptr to NULL because of gcc compatibility