Dinesh,
I failed to mention that the NullPointerException has already been fixed on HEAD (not that it makes any difference to you -- the ClassCastException needs to be fixed...).
--kevan