Files fixes and logging tweaks