Some fixes I forgot to include and badger work
Merge remote-tracking branch 'upstream/master'