Removes extraneous characters