Fixing CA2202: Do not dispose objects multiple times code analysis error.