Fix and test for invoke_unchecked