Fixed bug in get_latest_revision