Added compare methods.

Lack of these methods caused compilation problems in some cases.