Treatments for controlling internal stress or strain in MEMS structures