Merged relevant bits from the master branch.
Merged relevant bits from the master branch.