Nebulizers are used to deliver a medicine to a patients lungs in the form of an airstream with fluid comprising the medicine entrained in the airstream. To enable the fluid to be entrained in the airstream a nebulizer contains an aerosol generator typically comprising a vibratory element (28) with a piezoelectric actuator. There is a need to frequently sterilize the nebulizer. This involves dipping the nebulizer in boiling water for a significant time. It has been found that repeated sterilization cycles can force water through gaps in the vibratory element and its encapsulation (26) and damage the piezo element. The present invention proposes to more effectively seal the piezo of the vibratory element (28) from the effects of water ingress. In particular it is proposed to create at an interface of the vibratory element (28) and the encapsulating element (26) a discontinuity which provides a barrier geometry. Through capillary forces the progress of water towards the piezoelectric element (12) comprised in the vibratory element (28) is arrested and the lifetime of the aerosol generator is improved.