Fix segfault in tag command