fixes model refs, fixes some mocha tests