MFC r268156:
Various bugfixes from Stefano GarzarellaA

This has been proved to fix reproducable panics on 10.x.

Sponsored by:	Multiplay