fixed null-pointer dereferencing and log message typo