Lots of bug fixes and small features