Fix CLI and writer