Synthetic CT (sCT) is a key component of adaptive MR-guided radiotherapy. Generation of thoracic sCT is challenging and benefits from ultrashort echo-time (UTE) imaging that provides contrast in short-T2* tissues such as bone and lung. However, UTE imaging is susceptible to artifacts caused by eddy currents and gradient delays. In this work, we measured the gradient impulse response function (GIRF) of an MR-Linac with standard scanner hardware and used it to retrospectively correct k-space trajectories. Images reconstructed with GIRF and gradient-delay corrected trajectories exhibited higher image quality, including reduced halo artifacts, blurring, destructive phase artifacts, and improved uniformity and contrast.