Several additions and fixes.