portability improvements
Merge commit '0b867d3'