Making tests a little more robust by checking for thead