ported to scala-2.11.0