Updated some cases where there are null pointer exceptions