Fix small bug in catch_warning; better code coverage