Updated inference mode thunking, fixed invalidation bugs during invalidation mode