Merge most important changes from the 'trash' branch.