Fixes Scala type inference problem.