Bug fixes all over the place