open files + other general fixes