Restored Python 2 compatibility.