Remove unnecessary spaces from output