Fixing errors, warnings and saving bugs