Check that operation is valid.