Fix up code based on inferred intent.