Fixed logging
Small improvements