Trim unused spaces