Fix some stuff as per the spec.