Actually fixed my bugs!

- Actually fixed the on-demand structs issue. Template appears to
  run much faster (previous update introduced bugs)
- Properly configured the optimize=true|false flags for structs