Handle db cursors better; tweak email output