fixed co-smart-cast and added 2 test cases

fixed co-smart-cast and added 2 test cases