Compare tool: Fix unbound local error caused by empty group