Manual merge of Luca Bocassi's LSRR patch
Further manual merge of Luca's patch
Finish merge of Luca's header patches
Fix from manual patch merge
Header patching complete