I've opened a patch to deal with this (#361) -- There are still some unnecessary casts in unit tests, though.