Fixed logging to have variables that exist.