Fix various bugs with TailCommand.