Fix some of the overflow issues during PDF processing.