Fix space termination issues