reorder calls (like they are on the dstk site) and fix failing tests