Added canonical Equals implementation for derived classes, and other tweaks.