Work around Scala bug