Fix compatability with 3.x