A bit nicer way of checking valid params.

Addressed that `TODO` with a check that should always work.