Fix clear_preexisting_handers functionality.