Security fixes for assigned templates
Parameters: Handle missing context