Safer compareTo in command