Fix codes using methods introduced in 1.8