Some code improvements.
Merge commits.