Fixed threading interface. Tests for the same.