Bug fixes and general housekeeping.