XS 2/3: test improvements, fixes to static XS from 168

Is branched from #176. Incorporates therefore close #75.