updated to fix unix shutdown sequence

Should fix crashes occuring from unix mode shutdown/cleanup phase.