Add assert.
Make checks on used inputs more stringent.
Make check_used_reg( ) and check_used_regs( ) public.