Fix test hang