Merge Giuseppe's fixes