Ensure python3 compatibility