fix specs and unit tests