Bring in changes from 0186dcfeecb6b985d8f3212bef4f5687bf6010d2 * new upstream version * applied build fixes