bug fixes all around