Crash fix and debug demo debug build fix

Here's the fixed destroyTechniques loop, and a little change to the demo code so the debug builds run.
This will break (as in, require manual adjustment) if plugins are installed system-wide.