Consitantly return NULL on error