Fixed making assertions on values that could be undefined