Python 3 compatibility (to be merged)