switched print result generation to fopen fprintf, several gcc fixes, added cast to fix_data_mask so that min and max are actually fixeds