I think I have figured it out. It was a bit of clever coding that has come back to bite us. The same function is being used to display the application/octet-stream button, and the action that fires when click mouse-2 on it. In the case that I ran into, the action was getting fired instead of the button creation.
I intend to separate the two things into separate functions. Cheers, Uday
