Fixed potential ArgumentOutOfRangeException.