Initial fix for tests (not complete)

Jira issue: WP-959