title: Dictionary<> is reporting invalid key when it's not
body: <p>I have some code that adds a <code>Func&lt;short&gt;</code> to a <code>Dictionary&lt;byte, Func&lt;short&gt;&gt;</code> at index 0. Later on, some code within the class that contains the dictionary attempts to extract this Func (via TryGetValue) and execute it, throwing an exception if it does not work. Even though the index being accessed is valid, it throws the exception that signifies the function extraction failed. Why is this? (can provide code if necessary)</p>
  
  <pre><code>    //processor construction and setup
      VirtualProcessor processor = new VirtualProcessor();
      ...
      processor.InputChannels.Add(0, () =&gt; { return 2; });//the func i'm trying to access
      //end processor construction and setup
      //build program
      Dictionary&lt;short, Command&gt; commands = new Dictionary&lt;short, Command&gt;();
      commands.Add(0, CommandFactory.CreateInputCommand(0, 0));//this, in a roundabout way, attempts to call the func
      commands.Add(1, CommandFactory.CreateLoadCommand(1, 200));
      commands.Add(2, CommandFactory.CreateAddCommand(0, 1, 2));
      commands.Add(3, CommandFactory.CreateHaltCommand());
      //end build program
      //execution
      processor.CurrentProgram = commands;
      processor.ExecuteTillHalt();
      //end execution
      Console.ReadLine();
  </code></pre>
  
  <p>Somewhere in a desert of switch cases, in another class...</p>
  
  <pre><code>    Func&lt;short&gt; inChannel;
      InputChannels.TryGetValue(command.Data2, out inChannel);//the attempt to access the func, this is the second value supplied to CreateInputCommand above
      if (inChannel != null)
              Registers[command.Data1] = inChannel();//should be here
      else
              throw new InvalidInputChannelException("Invalid input channel " + command.Data2); //throws this
  </code></pre>