scala 2.10 support: Kills type erasure warnings with a few casts and cle...

...ans up a bit