Fix bug in readhres.py