Merge linux-friendly improvements

Change-Id: I8ffe35a2646369f3ba680b469e4eb62dcd151ccf