s4-waf: merge in the latest changes from master