Fix py3 exceptions.