Reduce logging and add debug switch.