A few improvements and fixes.