Fix NPE caused by configuration change + provide more logging