Merge async logging and some other improvements.