Fixes and tweaks for main file;