More and better logging and cosmetic changes