Merge from trevd-cleanup