bug fixes all over the place