Updated to register console handler, which seems to be enough to cause cleanup routines to usually run