Make more Python 3 compatible