Updated Logging and a few bug fixes