Some save-analysis bug fixes

r? @huonw