diff --git a/src/pixie/fontformats/opentype.nim b/src/pixie/fontformats/opentype.nim
index e34cce6..84d7f34 100644
--- a/src/pixie/fontformats/opentype.nim
+++ b/src/pixie/fontformats/opentype.nim
@@ -1,4 +1,4 @@
-import bitops, flatty/binny, math, pixie/common, pixie/paths, sets, tables,
+import flatty/binny, math, pixie/common, pixie/paths, sets, tables,
     unicode, vmath
 
 ## See https://docs.microsoft.com/en-us/typography/opentype/spec/
@@ -867,8 +867,15 @@ proc parseCoverage(buf: string, offset: int): Coverage =
     else:
       failUnsupported()
 
-proc valueFormatSize(valueFormat: uint16): int {.inline.} =
-  countSetBits(valueFormat) * 2
+proc valueFormatSize(valueFormat: uint16): int =
+  # countSetBits(valueFormat) * 2
+  var
+    n = valueFormat
+    bitsSet: int
+  while n > 0:
+    n = (n and (n - 1))
+    inc bitsSet
+  bitsSet * 2
 
 proc parseValueRecord(
   buf: string, offset: int, valueFormat: uint16
diff --git a/src/pixie/fonts.nim b/src/pixie/fonts.nim
index 73a257a..b7cfe73 100644
--- a/src/pixie/fonts.nim
+++ b/src/pixie/fonts.nim
@@ -413,7 +413,7 @@ proc parseOtf*(buf: string): Font =
   result.typeface.opentype = parseOpenType(buf)
   result.size = 12
   result.lineHeight = AutoLineHeight
-  result.paint = Paint(kind: pkSolid, color: rgbx(0, 0, 0, 255))
+  result.paint = rgbx(0, 0, 0, 255)
 
 proc parseTtf*(buf: string): Font =
   parseOtf(buf)
diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim
index 39b8aff..34dfb9e 100644
--- a/src/pixie/paths.nim
+++ b/src/pixie/paths.nim
@@ -500,6 +500,11 @@ proc roundedRect*(
   ## Adds a rounded rectangle.
   ## Clockwise param can be used to subtract a rect from a path when using
   ## even-odd winding rule.
+
+  if nw == 0 and ne == 0 and se == 0 and sw == 0:
+    path.rect(x, y, w, h, clockwise)
+    return
+
   let
     s = splineCircleK
 
@@ -1551,9 +1556,10 @@ proc fillPath*(
 ) =
   ## Fills a path.
   if paint.kind == pkSolid:
-    var shapes = parseSomePath(path, transform.pixelScale())
-    shapes.transform(transform)
-    image.fillShapes(shapes, paint.color, windingRule, paint.blendMode)
+    if paint.color.a > 0:
+      var shapes = parseSomePath(path, transform.pixelScale())
+      shapes.transform(transform)
+      image.fillShapes(shapes, paint.color, windingRule, paint.blendMode)
     return
 
   let
@@ -1614,16 +1620,17 @@ proc strokePath*(
 ) =
   ## Strokes a path.
   if paint.kind == pkSolid:
-    var strokeShapes = strokeShapes(
-      parseSomePath(path, transform.pixelScale()),
-      strokeWidth,
-      lineCap,
-      lineJoin,
-      miterLimit,
-      dashes
-    )
-    strokeShapes.transform(transform)
-    image.fillShapes(strokeShapes, paint.color, wrNonZero, paint.blendMode)
+    if paint.color.a > 0:
+      var strokeShapes = strokeShapes(
+        parseSomePath(path, transform.pixelScale()),
+        strokeWidth,
+        lineCap,
+        lineJoin,
+        miterLimit,
+        dashes
+      )
+      strokeShapes.transform(transform)
+      image.fillShapes(strokeShapes, paint.color, wrNonZero, paint.blendMode)
     return
 
   let