Fix for warning messages logging to the console as 'undefined'