LPS-41975 properly handle null structure and template keys