Clean up logging and debugging code