Fix cowboy bug with missing terminate