backport minor p2 changes to master: jit, flags init