Goodm bunch of bug fixes