minor changes in logging, few bugs fixed