Merge "More correct startup and shutdown procedures."