MacOSX fix. I wonder why this worked on Windows... seems like argument conversion from JS to SWT (Java) breaks everything down. It's hard to debug, but I eventually figured it out. Wrapping in an empty function seems to fix things.