Added check for IV length