multiple fixes; merging passes all simple tests