Fix python3 issues with backend code.

Change-Id: I66b56cff1db0fa555684b4fd34ba1c487b7480cf