Improve code documentation
Compare pointed-to objects instead of pointers

Regression introduced by commit ebc822984a6d0c7829efee8daa38cdccc828093a.