Improved logging messages and fixed null pointer acception in log msg