Minor cleanup
Write session files