Removing erroneous spaces