Simplify deeply nested 'if' statements in 'set_enc_options'.