Lots of good bug fixes