Added a NULL return if functions fails, no, assert(0) is NOT enough