Modified logging and some other stuff