fixed some bugs for different configuration setups, and improved logging