assorted little fixes

Also, have had problems with closing packages that have been added to; writing seems to mess with reading the file headers. So expect a rewritten file closing method soon.