Various changes.

Look at each class if you want to know the changes in detail.