manually merged Riccardo's WFQ branch (from svn)