In any distributed power system where the impedance of the generator is non-negligible compared to the impedance of its nonlinear loads, the source voltage typically contains some distortion. Specifically, US Navy ship power generators experience a significant amount of voltage distortion. Since Shunt Active Power Filters (SAPFs) normally use the waveform of the source voltage for their reference generator, a significant voltage distortion can create undesired harmonics in the current reference, thus inject undesired harmonics into the line. This paper proposes a phase adjusting algorithm that is robust to source voltage distortion. Low Pass Filter (LPF) is utilized to suppress the distortion; phase shift caused by LPF or other factors is adaptively adjusted to zero by closed loop control. This approach can be implemented in either Instantaneous Reactive Power Theory based control or Synchronous Reference Frame Theory based control and no predictive estimations are needed for precise synchronization.