Fixed printing the proper warning message when a warning occurs.