Fix TC-2027

See problem details in the corresponding JIRA issue.