core: Ensure int type for mix and max