better log messages and minor fixes