Fixed issues in AddView to make tests pass