Couple of changes for python3 compatible