diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,6 @@
+0.2.1.2
+* Fixed bug introduced at 0.2.1.1 where RelativeRefs would fail to serialize their port numbers.
+
 0.2.1.1
 * Add URI normalization features.
 
diff --git a/src/URI/ByteString/Internal.hs b/src/URI/ByteString/Internal.hs
--- a/src/URI/ByteString/Internal.hs
+++ b/src/URI/ByteString/Internal.hs
@@ -272,10 +272,10 @@
     port = maybe mempty packPort effectivePort
     effectivePort = do
       p <- authorityPort
-      scheme <- mScheme
-      dropPort scheme p
+      dropPort mScheme p
     packPort (Port p) = c8 ':' <> BB.fromString (show p)
-    dropPort scheme
+    dropPort Nothing = Just
+    dropPort (Just scheme)
       | unoDropDefPort = dropPort' scheme
       | otherwise = Just
     dropPort' s p
diff --git a/test/URI/ByteStringTests.hs b/test/URI/ByteStringTests.hs
--- a/test/URI/ByteStringTests.hs
+++ b/test/URI/ByteStringTests.hs
@@ -320,21 +320,31 @@
     testCase "renders userinfo correctly" $ do
        let ui = UserInfo "user" "pass"
        let uri = URI (Scheme "http")
-                 (Just (Authority (Just ui) (Host "www.example.org") Nothing))
+                 (Just (Authority (Just ui) (Host "www.example.org") (Just port)))
                  "/"
                  (Query [("foo", "bar")])
                  (Just "somefragment")
        let res = BB.toLazyByteString (serializeURIRef uri)
-       res @?= "http://user:pass@www.example.org/?foo=bar#somefragment"
+       res @?= "http://user:pass@www.example.org:123/?foo=bar#somefragment"
   , testCase "encodes decoded paths" $ do
        let uri = URI (Scheme "http")
-                 (Just (Authority Nothing (Host "www.example.org") Nothing))
+                 (Just (Authority Nothing (Host "www.example.org") (Just port)))
                  "/weird path"
                  (Query [])
                  Nothing
        let res = BB.toLazyByteString (serializeURIRef uri)
-       res @?= "http://www.example.org/weird%20path"
+       res @?= "http://www.example.org:123/weird%20path"
+  , testCase "encodes relative refs" $ do
+      let ui = UserInfo "user" "pass"
+      let uri = RelativeRef (Just (Authority (Just ui) (Host "www.example.org") (Just port)))
+                "/"
+                (Query [("foo", "bar")])
+                (Just "somefragment")
+      let res = BB.toLazyByteString (serializeURIRef uri)
+      res @?= "//user:pass@www.example.org:123/?foo=bar#somefragment"
   ]
+  where
+    port = Port 123
 
 
 -------------------------------------------------------------------------------
diff --git a/uri-bytestring.cabal b/uri-bytestring.cabal
--- a/uri-bytestring.cabal
+++ b/uri-bytestring.cabal
@@ -1,5 +1,5 @@
 name:                uri-bytestring
-version:             0.2.1.1
+version:             0.2.1.2
 synopsis:            Haskell URI parsing as ByteStrings
 description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data.
 license:             BSD3
