Integration

Merging the mainline changes into my fork.