fix issue #2229 (cast and convert not working)