Fix null pointers