Replace deprecated function.

Map.elements method is deprecated in Scala 2.9. In addition,  it has deleted in Scala 2.10. 
Replaced with not use elements method.