Fix "JS confirm" and "undefined variable" bugs.

Fix bug with JS confirm dialog in batch actions.
Fix "undefined variable exception" in generated controller STUBs for object actions.