Improve debug messages when running on command line