fix bug in wetting algorithm