Adding an assert to make sure inputs are valid.