Updated logging and error messages