Better display for errors in logger/fix some null pointers issues