Merge bug fix updates from upstream