Some more tests and tightening, based on regressions from the web app. #68