Merge in changes from @todb-r7.