fixing unregister and minor bugs
Jira-issue: WP-1226