Added updates for future Python3 compatibility