OpenCS: Avoid out of range exceptions.