Added protection against nulls.