Fix bugs at startup and shutdown