Fixing the main file, which in turn brought some other issues with it