Ported to 1.6.4.