Logging bugs fixed