Fixed a bug in endorse_resource() and endorse_comment()