incorporating latest upstream changes