Fix pre-exec bugs