Fixing Problems with ClassCast Exception - TRUNK-4053