Fix logging config and unregister bug