Fixed two issues

- Template was null on rendering (sometimes)
- Event initialization failed