Fixing out of bounds asses error
Merge pull request #4966

c8063b5 Fixing out of bounds asses error (ENikS)