Squashed a lot of bugs