Check if msg.script.is_witness_program() before checking version