State saving for PIT and compile fixes