fix bug in backend_list:handlecast; fix tests