scala 2.10 support: Kills type erasure warnings with a few casts and cleans up a bit