Remove extra lines and spaces