Fixed two bugs related to unexpected/unchecked values.