Bug fixes. Included logs and error detectors