fix tests, inspired by @lwf