Fix occurrences of out of range exceptions

cf. Xcode's analyzer warning. Encountered in real world with [vienna-rss](https://github.com/ViennaRSS/vienna-rss/)'s "Unified" layout.