Standard code for check files
Fix dumb bugs