Which kingdom lost some Thuringian territory?