Various fixes. Logging now functional.