misc. bug fixes
minor changes in sub-files