Layer fluctuations and hexatic order in liquid crystals