Add tests and use safer method for RemoveIf