bugfixes, including #8129 and #8132