Expanded the fix from  to cover bic, orr cases. Also fixed some internal test failures (adding necessary casts).
Please commit this patch if you think it looks OK. I've asked for commit rights in the meantime.
Yep. Looks fine to me so I've committed it in r217159.