Phase distortion and thickness variation in the design of optical coatings