You should be careful about having too many commands after your Shutdown() command. You'll generate errors as KiX is still running while the system is shutting down.