Fix test failures when run as root