hand-merged with branch 'wake'