Some cleanup and small modifications.