Improve cast parsing.