Fixed connect thread bug

Fixed the connect thread bug that resulted from changing disconnect
method variables and caused connections to never work. Will have to put
in a real fix later.

Changed (obj.type == typeof (int)) to (obj.type.Equals(typeof (int)).
- This is mostly a change for Mono, as former way will bring up issues.
- Also it's a better way and more correct way to do the check.