merged more changes from newer upstream release
updated last part of changes from latest upstream changes