xcompile: Use local variables and make cosmetic changes