Lots of bug fixes.