Fix more debug messages
Add better logging and ability to log in debug