This change is a reaction to bug, fixed in changeset 5b093c3. Although
the bug was fixed on a higher level, it would have been detected much
earlier if we would have had the range checks that we now have.
This patch was prepared by Philipp Takacs <philipp@bureaucracy.de>.