Fixed shutdown on Windows and added shutdownInternal on Platform.