Replace reference equality with value equality for valuetypes.
[GtkCore] Fix a conditional which never passed.
Fix infinite loops.
Merge pull request #426 from mono/codeIssueFixes

Functionality and code issues fixes