Lots of stuffis

Work from base dir.
Close files.