Added stop and restart; cleaned up shutdown