Lots of updates and bug fixes