pfm: repair pfm reading broken in ee49ae3

(cherry picked from commit ae49842f3a77d8c836b50571e9794ebd94f9ad5b)
Fix some potential negative array index reads/writes
Coverity CID 1034351, CID 1034353, CID 1034354, CID 1034352, CID 1034355, CID 1034356

(cherry picked from commit ca15484c63cfb20f1e049518d6f3d7c3b74203cf)
Fix potential negative array index read
Coverity CID 1034502

(cherry picked from commit 746440a082373240ddb2a4e70e82551e7afe1ebb)
EXPERIMENTAL Fix for potential memory corruption in zonesystem
Coverity CID 1034335

(cherry picked from commit 6754d3d7f8b2d6fee138cad372527b08a7e22658)