diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+2020-11-11 v0.6.3.3
+	* Sort comments properly, ignoring SrcSpan's file by @zliu41
 2020-07-16 v0.6.3.2
 	* Add support for GHC 8.8.4
 2020-06-13 v0.6.3.1
diff --git a/ghc-exactprint.cabal b/ghc-exactprint.cabal
--- a/ghc-exactprint.cabal
+++ b/ghc-exactprint.cabal
@@ -1,5 +1,5 @@
 name:                ghc-exactprint
-version:             0.6.3.2
+version:             0.6.3.3
 synopsis:            ExactPrint for GHC
 description:         Using the API Annotations available from GHC 7.10.2, this
                      library provides a means to round trip any code that can
@@ -45,6 +45,7 @@
                    , GHC == 8.8.3
                    , GHC == 8.8.4
                    , GHC == 8.10.1
+                   , GHC == 8.10.2
 extra-source-files:  ChangeLog
                      src-ghc710/Language/Haskell/GHC/ExactPrint/*.hs
                      tests/examples/failing/*.hs
diff --git a/src/Language/Haskell/GHC/ExactPrint/Delta.hs b/src/Language/Haskell/GHC/ExactPrint/Delta.hs
--- a/src/Language/Haskell/GHC/ExactPrint/Delta.hs
+++ b/src/Language/Haskell/GHC/ExactPrint/Delta.hs
@@ -129,7 +129,7 @@
 import Control.Monad.Trans.Free
 
 import Data.Data (Data)
-import Data.List (sort, nub, partition, sortBy)
+import Data.List (sort, nub, partition, sortBy, sortOn)
 
 import Data.Ord
 
@@ -746,8 +746,15 @@
   cs <- getUnallocatedComments
   let (allocated,cs') = allocateComments p cs
   putUnallocatedComments cs'
-  k =<< mapM makeDeltaComment (sortBy (comparing commentIdentifier) allocated)
-
+  k =<< mapM makeDeltaComment (sortOn (unpack . commentIdentifier) allocated)
+  where
+    -- unpack a RealSrcSpan into ((start line, start col), (end line, end col)).
+    -- The file name is ignored.
+    unpack :: GHC.SrcSpan -> Maybe ((Int, Int), (Int, Int))
+    unpack (GHC.RealSrcSpan x) =
+       Just ( (GHC.srcSpanStartLine x, GHC.srcSpanStartCol x)
+            , (GHC.srcSpanEndLine x, GHC.srcSpanEndCol x) )
+    unpack _ = Nothing
 
 makeDeltaComment :: Comment -> Delta (Comment, DeltaPos)
 makeDeltaComment c = do
@@ -875,4 +882,3 @@
 countAnnsDelta ann = do
   ma <- peekAnnotationDelta ann
   return (length ma)
-
diff --git a/src/Language/Haskell/GHC/ExactPrint/Parsers.hs b/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
--- a/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
+++ b/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
@@ -338,10 +338,10 @@
   :: Either a (GHC.ApiAnns, [Comment], GHC.DynFlags, GHC.ParsedSource)
   -> DeltaOptions
   -> Either a (Anns, GHC.ParsedSource)
-postParseTransform parseRes opts = either Left mkAnns parseRes
+postParseTransform parseRes opts = fmap mkAnns parseRes
   where
     mkAnns (apianns, cs, _, m) =
-      Right (relativiseApiAnnsWithOptions opts cs m apianns, m)
+      (relativiseApiAnnsWithOptions opts cs m apianns, m)
 
 -- | Internal function. Initializes DynFlags value for parsing.
 --
diff --git a/tests/Test/Common.hs b/tests/Test/Common.hs
--- a/tests/Test/Common.hs
+++ b/tests/Test/Common.hs
@@ -63,7 +63,7 @@
 
 -- import Debug.Trace
 testPrefix :: FilePath
-testPrefix = "tests" </> "examples"
+testPrefix = "." </> "tests" </> "examples"
 
 testList :: String -> [Test] -> Test
 testList s ts = TestLabel s (TestList ts)
diff --git a/tests/examples/failing/overloadedlabelsrun04.hs.bad b/tests/examples/failing/overloadedlabelsrun04.hs.bad
--- a/tests/examples/failing/overloadedlabelsrun04.hs.bad
+++ b/tests/examples/failing/overloadedlabelsrun04.hs.bad
@@ -2,17 +2,11 @@
 
 import OverloadedLabelsRun04_A
 
-
-
+-- Who knew that there were so many ways that a line could start with
+-- a # sign in Haskell? None of these are overloaded labels:
 
 
 #!notashellscript
 
 -- But this one is:
--- a # sign in Haskell? None of these are overloaded labels:
-
-
-
-
-
 #foo
