Improve handling of guard runs in compilation mode