I tried using this on a website running .NET 4 and I keep getting the error below. Any ideas?

Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Index and count must refer to a location within the string.
Parameter name: count
at System.String.RemoveInternal(Int32 startIndex, Int32 count)
at System.String.Remove(Int32 startIndex, Int32 count)
at blowery.Web.HttpCompress.HttpModule.CompressContent(Object sender, EventArgs e)