fix make check, ported from master