Add instance ID support; improve logging