Fixed file name issues -- not perfect, but it works