Fixed some stuff

There was some stuff that didn't work right for some reason. I fixed
most of it, except that total and current line get off track when you
delete past the last line.