Improved handling of warnings