Most likely the headaches are caused by an improper fitting mask and headgear.
I use NasalAire headgear. Some of this brand's products do not have head straps. Some do not touch face. I couldn't stand wearing a mask, pushing on my face. Check out link
http://www.innomedinc.com/content/
I have migraines when I don't sleep well. Almost always I have headaches when I do not use my machine.