Guard Repository.Ignore against invalid parameters

Fix #346