fix tests
Thanks to Gordon Chan for a pull request