removed redundant bare_type, test return only from functions with error msg otherwise