fix bug throwing ArgumentOutOfRangeException in EmptyBuffer