Some cleanup and a last couple of fixes.