Fix read out of bounds error
Merge pull request #2097 from mdboom/wcs/read-out-of-bounds

Fix read out of bounds error in `wcs`