I have App Inventor app that connects my Android via Bluetooth to a Lego NXT brick running LeJOS. All of the remote control functions work perfectly except for the that attempts to use NXTdirectcommands; on that one I get "Error 401: the Bluetooth property has not been set."
I am mystified by this error, as all of the other commands (for controlling the motors) work just fine, both before and after I click the Run Program button and receive the error. Here's a screencap of my blocks:

The one that's giving me trouble is the last one, "when ProgramButton.Click." My original intention was to have it run a program stored on the brick, but since that wasn't working I tried the current incarnation, in which I'm just trying to get the NXT brick to play a tone - instead I get the bluetooth error. Anybody know what I'm doing wrong?