merging fix into badger, and a plethora of other changes