Fix some logging and other stuff