Replaced a call to == with ReferenceEquals when checking for null to avoid cycles in == operators.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>