Some cleanup and fixing.