Fix Scala code