Improved loggin, minor changes