Fix Python 3 list handling.