Fixed failing test caused by not doing a nil check