cleanup of some bugs, test setup fixed.