Some cleanup and minor fixes.