Some cleanup. Long time since last looking at the code.