Fixed python2 -> python3 prints and exception handlers for the 3.x version.