File interface and minor fixes