Avoiding code that would cause problems for headpin