Clean up and sanitize pairread()

Should fix a number of coverity issues