Removes extra space and space on line endings