Sorting out a bunch of small bugs