Fix space trimming