Small improvements to warning handling