Improved logging, message handling cleanup