A bunch of nice bug fixes