add debug output and fix command line prefixes