Bug fix and file prep