Lots of small things, plus some unit tests around package merging.