Fixed error when a value is null