Some cleanup for the secured shell