several fixes, core_spec.lua and cl_spec.lua now pass