Added a message selector and a message sink. Changes to some signatures