Fix #771 — For some reason max can be int or long.