Added cast in try_parse()