Fix type class instances scope issue