Clean up logging and other minor issues