fixed a typecheck error using cast in peerinfo.py