Lots of bug fixes and updates