Fix for debug output when shutting down

also extended make_kit.py