A lot of minor changes and bug fixes.