lots of bug fixes and updates