Some bug fixes, tons of broken tests