Some syntax fixing and some tweaks to logging.