Repair bug of wrong timeout variable in automatic shutdown and some formating